<?php

class Teacher extends BaseTeacher
{
	public function __toString() {
		return $this->getTeacherFirstName() . " " . $this->getTeacherLastName();
	}

	public function delete(PropelPDO $con = null)
   {
    	parent::delete($con);
		
		if(file_exists(sfConfig::get('sf_upload_dir').'/assets/teacher/'.utilities::getSpreadPathByDate($this->getCreatedAt()).'/'.$this->getTeacherAvatarImg())) {
    		unlink(sfConfig::get('sf_upload_dir').'/assets/teacher/'.utilities::getSpreadPathByDate($this->getCreatedAt()).'/'.$this->getTeacherAvatarImg());
			unlink(sfConfig::get('sf_upload_dir').'/assets/teacher/'.utilities::getSpreadPathByDate($this->getCreatedAt()).'/thumb_'.$this->getTeacherAvatarImg());
			//$datetime = date_create($this->getCreatedAt());
			//$pathDelete = sfConfig::get('sf_upload_dir').'/assets/news/'.date_format($datetime, 'Y/m');
			//utilities::deleteAll($pathDelete, true);
		}
				
   }
   //teacher_avatar_img
  
}
